{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "2370d137",
   "metadata": {},
   "source": [
    "# 人脸识别实践——宿舍智能识别门禁系统（未来某栋）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a333c1bb",
   "metadata": {},
   "source": [
    "1、创建FaceSet\n",
    "2、查询FaceSet\n",
    "3、存入face_token数据\n",
    "4、获取FaceSet信息数据\n",
    "5、人脸搜索\n",
    "6、人脸对比"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ad8f319d",
   "metadata": {},
   "source": [
    "# 创建faceset  \n",
    "\n",
    "1、创建一个人脸的集合 FaceSet，用于存储人脸标识 face_token。一个 FaceSet 能够存储10000个 face_token。\n",
    "\n",
    "\n",
    "2、试用API Key可以创建1000个FaceSet，正式API Key可以创建10000个FaceSet。\n",
    "\n",
    "调用URL\n",
    "https://api-cn.faceplusplus.com/facepp/v3/faceset/create\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "36cc4f32",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "712bbeac",
   "metadata": {},
   "source": [
    "pd.read.html<table class=\"wrapped confluenceTable\"><colgroup><col><col><col><col></colgroup><tbody><tr><th class=\"confluenceTh\"><p><span style=\"color: rgb(0,0,0);\">是否必选</span></p></th><th class=\"confluenceTh\"><p><span style=\"color: rgb(0,0,0);\">参数名</span></p></th><th class=\"confluenceTh\"><p><span style=\"color: rgb(0,0,0);\">类型</span></p></th><th class=\"confluenceTh\"><p><span style=\"color: rgb(0,0,0);\">参数说明</span></p></th></tr><tr><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">必选</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">api_key</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">String</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">调用此 API 的 API Key</span></p></td></tr><tr><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">必选</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">api_secret</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">String</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">调用此 API 的 API Secret</span></p></td></tr><tr><td class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">可选</span></td><td class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">display_name</span></td><td class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">String</span></td><td class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">人脸集合的名字，最长<span class=\"inline-comment-marker\" data-ref=\"9f098728-ac30-41a2-aab6-05b79f8a7d2e\">256</span>个字符，不能包括字符^@,&amp;=*'\"</span></td></tr><tr><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">可选</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">outer_id</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">String</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">账号下全局唯一的 FaceSet 自定义标识，可以用来管理 FaceSet 对象。最长255个字符，<span class=\"inline-comment-marker\" data-ref=\"63fc0fd1-cd44-4256-bab5-971a939d66e2\"><span class=\"inline-comment-marker\" data-ref=\"183dcb11-c22c-47f4-aa9c-2ba6f3c8210c\">不能包括字符^@,&amp;=*'\"</span></span></span></td></tr><tr><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">可选</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">tags</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">String</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">FaceSet 自定义标签组成的字符串，用来对 FaceSet 分组。最长<span class=\"inline-comment-marker\" data-ref=\"1be760b6-f20d-4ff3-a086-b7f763abd84d\">255</span>个字符，多个 tag 用逗号分隔，每个 tag 不能包括字符^@,&amp;=*'\"</span></td></tr><tr><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">可选</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">face_tokens</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">String</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">人脸标识 face_token，可以是一个或者多个，用逗号分隔。最多不超过5个 face_token</span></p></td></tr><tr><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">可选</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">user_data</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">String</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">自定义用户信息，不大于<span class=\"inline-comment-marker\" data-ref=\"f9edadb1-691d-4d80-933e-909096780f61\">16 KB，不能包括字符^@,&amp;=*'\"</span></span></td></tr><tr><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">可选</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">force_merge</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">Int</span></td><td colspan=\"1\" class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">在传入 outer_id 的情况下，如果 outer_id 已经存在，是否将 face_token 加入已经存在的 FaceSet 中</span></p><p><span style=\"color: rgb(0,0,0);\">0：不将 face_tokens 加入已存在的 FaceSet 中，直接返回 FACESET_EXIST 错误</span></p><p><span style=\"color: rgb(0,0,0);\">1：将 face_tokens 加入已存在的 FaceSet 中</span></p><p><span style=\"color: rgb(0,0,0);\">默认值为0</span></p></td></tr></tbody></table>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "74ebc585",
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "c6e0ddcb",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. url\n",
    "Faceset_create_url = 'https://api-cn.faceplusplus.com/facepp/v3/faceset/create'\n",
    "\n",
    "\n",
    "# 2. api账户/通行证\n",
    "API_key = 'YIUFs5c8DQtx7GYlMouKt1a2ZMhdit7c'\n",
    "API_sercret = 'IVewMEENcvLCqvbAAthOQA5wIc93DJWu'\n",
    "\n",
    "# 3. POST\n",
    "\n",
    "\n",
    "# 4. 所有 API Key 都可以调用本 API。\n",
    "#    其中 calculate_all 和 face_rectangle 参数只有正式 API Key 才能使用，试用 API Key 无法使用。\n",
    "\n",
    "# 5. payload： 酬载, 必要阅读api文档中的 *必选项* 和 *可选性*，及 *参数说明*\n",
    "payload = {\n",
    "    'api_key':API_key,\n",
    "    'api_secret':API_sercret,\n",
    "    'image_url':'https://tse1-mm.cn.bing.net/th/id/OIP-C.HPWFQ7UDQh93EKcDmiUQ_wHaIR?w=176&h=197&c=7&r=0&o=5&dpr=2&pid=1.7'    \n",
    "}\n",
    "\n",
    "r = requests.post(Faceset_create_url, params = payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "9e62bc93",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'faceset_token': 'cbeab236f6dfda28095e78ad2e3d5747',\n",
       " 'time_used': 149,\n",
       " 'face_count': 0,\n",
       " 'face_added': 0,\n",
       " 'request_id': '1649070858,e9486add-dabe-4630-a89f-39587df94881',\n",
       " 'outer_id': '',\n",
       " 'failure_detail': []}"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ee3171ea",
   "metadata": {},
   "source": [
    "# 2.查询Faceset"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "85c6ddfb",
   "metadata": {},
   "source": [
    "版本\n",
    " 3.0\n",
    "\n",
    "描述\n",
    "获取某一 API Key 下的 FaceSet 列表及其 faceset_token、outer_id、display_name 和 tags 等信息。\n",
    "\n",
    "注意：2017年8月16日后，调用本接口将不会一次性返回全量的 FaceSet。单次查询最多返回 100 个 FaceSet。如需获取全量数据，需要配合使用 start 和 next 参数。请尽快修改调整您的程序。\n",
    "\n",
    "调用URL\n",
    "https://api-cn.faceplusplus.com/facepp/v3/faceset/getfacesets\n",
    "\n",
    "调用方法\n",
    "POST\n",
    "\n",
    "权限\n",
    "所有 API Key 都可以调用本 API。\n",
    "\n",
    "请求参数"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d0e8999d",
   "metadata": {},
   "source": [
    "<table class=\"wrapped confluenceTable\"><colgroup><col><col><col><col></colgroup><tbody><tr><th class=\"confluenceTh\"><p><span style=\"color: rgb(0,0,0);\">是否必选</span></p></th><th class=\"confluenceTh\"><p><span style=\"color: rgb(0,0,0);\">参数名</span></p></th><th class=\"confluenceTh\"><p><span style=\"color: rgb(0,0,0);\">类型</span></p></th><th class=\"confluenceTh\"><p><span style=\"color: rgb(0,0,0);\">参数说明</span></p></th></tr><tr><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">必选</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">api_key</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">String</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">调用此API的API Key</span></p></td></tr><tr><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">必选</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">api_secret</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">String</span></p></td><td class=\"confluenceTd\"><p><span style=\"color: rgb(0,0,0);\">调用此API的API Secret</span></p></td></tr><tr><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">可选</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">tags</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">String</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">包含需要查询的FaceSet标签的字符串，用逗号分隔</span></td></tr><tr><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">可选</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">start</span></td><td colspan=\"1\" class=\"confluenceTd\"><span style=\"color: rgb(0,0,0);\">Int</span></td><td colspan=\"1\" class=\"confluenceTd\"><p class=\"p1\"><span style=\"color: rgb(0,0,0);\">一个数字 n，表示开始返回的 faceset_token 在传入的 API Key 下的序号。</span></p><p><span style=\"color: rgb(0,0,0);\">通过传入数字 n，可以控制本 API 从第 n 个 faceset_token 开始返回。返回的 faceset_token 按照创建时间排序。每次返回<span class=\"s1\">1000</span>个<span class=\"s1\">FaceSets</span>。</span></p><p class=\"p1\"><span style=\"color: rgb(0,0,0);\">默认值为1。</span></p><p class=\"p1\"><span style=\"color: rgb(255,0,0);\">注意：2017年8月16日后，每次返回的 FaceSet 数量上限从 1000 改为 100。并且您可以输入上一次请求本 API 返回的 next 值，用以获得接下来的 100 个 faceset_token。请尽快修改调整您的程序。</span></p></td></tr></tbody></table>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "9daee72d",
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "# 1. url\n",
    "Faceset_getfaceset_url = 'https://api-cn.faceplusplus.com/facepp/v3/faceset/getfacesets'\n",
    "\n",
    "\n",
    "# 2. api账户/通行证\n",
    "API_key = 'YIUFs5c8DQtx7GYlMouKt1a2ZMhdit7c'\n",
    "API_sercret = 'IVewMEENcvLCqvbAAthOQA5wIc93DJWu'\n",
    "\n",
    "# 3. POST\n",
    "\n",
    "\n",
    "# 4. 所有 API Key 都可以调用本 API。\n",
    "#    其中 calculate_all 和 face_rectangle 参数只有正式 API Key 才能使用，试用 API Key 无法使用。\n",
    "\n",
    "# 5. payload： 酬载, 必要阅读api文档中的 *必选项* 和 *可选性*，及 *参数说明*\n",
    "payload = {\n",
    "    'api_key':API_key,\n",
    "    'api_secret':API_sercret,\n",
    "   \n",
    "}\n",
    "\n",
    "r = requests.post(Faceset_getfaceset_url, params = payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "bd510f4f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "240d9898",
   "metadata": {},
   "outputs": [],
   "source": [
    "faceset_token=r.json()['facesets'][-1]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "4d56f969",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'cbeab236f6dfda28095e78ad2e3d5747'"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "faceset_token = r.json()['facesets'][-1]['faceset_token']\n",
    "faceset_token"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "aaa5aeee",
   "metadata": {},
   "source": [
    "# 3.更新人脸库信息api"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8ca87040",
   "metadata": {},
   "source": [
    "描述\n",
    "更新一个人脸集合的属性\n",
    "\n",
    "调用URL\n",
    "https://api-cn.faceplusplus.com/facepp/v3/faceset/update\n",
    "\n",
    "调用方法\n",
    "POST\n",
    "\n",
    "权限\n",
    "所有 API Key 都可以调用本 API。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "2bec1bd2",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid character in identifier (<ipython-input-35-e2e13bdb6aee>, line 19)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  File \u001b[1;32m\"<ipython-input-35-e2e13bdb6aee>\"\u001b[1;36m, line \u001b[1;32m19\u001b[0m\n\u001b[1;33m    'faceset_token': faceset_token，\u001b[0m\n\u001b[1;37m                                  ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid character in identifier\n"
     ]
    }
   ],
   "source": [
    "# 1. url\n",
    "Faceset_update_url = 'https://api-cn.faceplusplus.com/facepp/v3/faceset/update'\n",
    "\n",
    "\n",
    "# 2. api账户/通行证\n",
    "API_key = 'YIUFs5c8DQtx7GYlMouKt1a2ZMhdit7c'\n",
    "API_sercret = 'IVewMEENcvLCqvbAAthOQA5wIc93DJWu'\n",
    "\n",
    "# 3. POST\n",
    "\n",
    "\n",
    "# 4. 所有 API Key 都可以调用本 API。\n",
    "#    其中 calculate_all 和 face_rectangle 参数只有正式 API Key 才能使用，试用 API Key 无法使用。\n",
    "\n",
    "# 5. payload： 酬载, 必要阅读api文档中的 *必选项* 和 *可选性*，及 *参数说明*\n",
    "payload = {\n",
    "    'api_key':API_key,\n",
    "    'api_secret':API_sercret,\n",
    "    'faceset_token': faceset_token，\n",
    "    'faceset_token':'广州南方学院西7栋学生宿舍楼'\n",
    "    'new_outer_id':'NFUSSX07'\n",
    "    'user_data':'6层，满员，女生宿舍，460同学，均已录入faceset_token'\n",
    "}\n",
    "#发起请求\n",
    "r = requests.post(Faceset_update_url, params = payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "bbe1d6d0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'time_used': 99,\n",
       " 'facesets': [{'faceset_token': '9664ff4ddb78c6be48b6bd8a999ba9e7',\n",
       "   'outer_id': '',\n",
       "   'display_name': '',\n",
       "   'tags': ''},\n",
       "  {'faceset_token': 'bdfa01bccebbd3e5b9337420c8a8fb96',\n",
       "   'outer_id': '',\n",
       "   'display_name': '',\n",
       "   'tags': ''},\n",
       "  {'faceset_token': '2956b7c532c22bc4143d6e578b6729f8',\n",
       "   'outer_id': '',\n",
       "   'display_name': '',\n",
       "   'tags': ''},\n",
       "  {'faceset_token': 'b3d426f0e12b54a4db4ec65a5240e615',\n",
       "   'outer_id': '',\n",
       "   'display_name': '',\n",
       "   'tags': ''},\n",
       "  {'faceset_token': '58b7a627132e762374bce61178b6003c',\n",
       "   'outer_id': '',\n",
       "   'display_name': '',\n",
       "   'tags': ''},\n",
       "  {'faceset_token': 'a818e01e28c80c172788eff33d045090',\n",
       "   'outer_id': '',\n",
       "   'display_name': '',\n",
       "   'tags': ''},\n",
       "  {'faceset_token': '6de0ce064fc757595841c069edf301b9',\n",
       "   'outer_id': '',\n",
       "   'display_name': '',\n",
       "   'tags': ''},\n",
       "  {'faceset_token': '5a4e5c5b1e5bb87c4914ba5315d38b24',\n",
       "   'outer_id': '',\n",
       "   'display_name': '',\n",
       "   'tags': ''},\n",
       "  {'faceset_token': 'cbeab236f6dfda28095e78ad2e3d5747',\n",
       "   'outer_id': '',\n",
       "   'display_name': '',\n",
       "   'tags': ''}],\n",
       " 'request_id': '1649070864,40256231-f4f9-4db0-833f-4be6cd4578d1'}"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "18dea5ca",
   "metadata": {},
   "source": [
    "# 4.检查数据集合信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b08c1487",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. url\n",
    "Faceset_getdetail_url = 'https://api-cn.faceplusplus.com/facepp/v3/faceset/getdetail'\n",
    "\n",
    "\n",
    "# 2. api账户/通行证\n",
    "API_key = 'YIUFs5c8DQtx7GYlMouKt1a2ZMhdit7c'\n",
    "API_sercret = 'IVewMEENcvLCqvbAAthOQA5wIc93DJWu'\n",
    "\n",
    "# 3. POST\n",
    "\n",
    "\n",
    "# 4. 所有 API Key 都可以调用本 API。\n",
    "#    其中 calculate_all 和 face_rectangle 参数只有正式 API Key 才能使用，试用 API Key 无法使用。\n",
    "\n",
    "# 5. payload： 酬载\n",
    "payload = {\n",
    "    'api_key':API_key,\n",
    "    'api_secret':API_sercret,\n",
    "    'outer_id':'NFUSSX07'\n",
    "   \n",
    "}\n",
    "\n",
    "r = requests.post(Faceset_getdetail_url, params = payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7fc78f2c",
   "metadata": {},
   "outputs": [],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e864ae00",
   "metadata": {},
   "source": [
    "# 5.人脸检测，获取人脸token"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9e35b4a7",
   "metadata": {},
   "outputs": [],
   "source": [
    "import detect"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6a3c9ff5",
   "metadata": {},
   "outputs": [],
   "source": [
    "help( detect)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "eac82af4",
   "metadata": {},
   "outputs": [],
   "source": [
    "detect.face_detect(API_key,API_secret,C:\\Users\\陈奕\\Desktop\\api\\week04,bai_01.jpg)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "08fc0f0c",
   "metadata": {},
   "source": [
    "# 6.人脸存放"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2c15ffa4",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. url\n",
    "Faceset_getdetail_url = 'https://api-cn.faceplusplus.com/facepp/v3/faceset/getdetail'\n",
    "\n",
    "\n",
    "# 2. api账户/通行证\n",
    "API_key = 'YIUFs5c8DQtx7GYlMouKt1a2ZMhdit7c'\n",
    "API_sercret = 'IVewMEENcvLCqvbAAthOQA5wIc93DJWu'\n",
    "\n",
    "# 3. POST\n",
    "\n",
    "\n",
    "# 4. 所有 API Key 都可以调用本 API。\n",
    "#    其中 calculate_all 和 face_rectangle 参数只有正式 API Key 才能使用，试用 API Key 无法使用。\n",
    "\n",
    "# 5. payload： 酬载\n",
    "payload = {\n",
    "    'api_key':API_key,\n",
    "    'api_secret':API_sercret,\n",
    "    'outer_id':'NFUSSX07'\n",
    "   \n",
    "}\n",
    "\n",
    "r = requests.post(Faceset_getdetail_url, params = payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b6fb9177",
   "metadata": {},
   "outputs": [],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "26e7ea3d",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a655c9eb",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
